// HotAnalysisResult.java
package com.scuec.groupfive.entity;

import lombok.Data;
import java.util.List;
import java.util.Map;

@Data
public class HotAnalysisResult {
    private List<ActiveUser> mostActiveUsers;
    private InteractionTrend interactionTrend;
    private List<PopularTag> popularTags;

    // 分页信息
    private int totalItems;
    private int currentPage;
    private int pageSize;
    private int totalPages; // 新增总页数字段

    public void setTotalItems(int size) {
        this.totalItems = size;
        // 计算总页数
        this.totalPages = (int) Math.ceil((double) size / this.pageSize);
    }

    public void setCurrentPage(int page) {
        this.currentPage = page;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
        // 当pageSize变化时，重新计算总页数
        if (this.totalItems > 0) {
            this.totalPages = (int) Math.ceil((double) this.totalItems / pageSize);
        }
    }
}

